//**********************************************************************************
//GMCMid1Quest2.java
//
//Name: Gabriel Martins	de	Castro
//Class:	COMSC	110L.51
//Date: 10/01/2014
//Instructor: Dr.	Chunyan Bai
//
//Purpose: Second question from midterm 1
//***********************************************************************************

import java.util.Scanner;
//Class
public class GMCMid1Quest2
{
	public static void main(String[]	args)//main	method
	{
      System.out.print("Enter an integer between 0 and 1000: ");
      Scanner input = new Scanner(System.in);
      int number = input.nextInt();
      
      //First get all the numbers
      int remainingNumber;
      remainingNumber = number;
      int hundreds;
      hundreds = remainingNumber/100;
      remainingNumber = remainingNumber%100;
      int tens;
      tens = remainingNumber/10;
      remainingNumber = remainingNumber%10;
      int ones;
      ones = remainingNumber;
      //Sum them and print the result
      System.out.print("The sum of the digits are : " + (hundreds+tens+ones));
   }
}